﻿using System;
using System.ComponentModel;
using System.Runtime.InteropServices;

namespace Teigha.Core
{
	public class OdGiLightTraitsData : IDisposable
	{
		[EditorBrowsable(EditorBrowsableState.Never)]
		public OdGiLightTraitsData(IntPtr cPtr, bool cMemoryOwn)
		{
			this.swigCMemOwn = cMemoryOwn;
			this.swigCPtr = new HandleRef(this, cPtr);
		}

		[EditorBrowsable(EditorBrowsableState.Never)]
		public static HandleRef getCPtr(OdGiLightTraitsData obj)
		{
			if (obj != null)
			{
				return obj.swigCPtr;
			}
			return new HandleRef(null, IntPtr.Zero);
		}

		~OdGiLightTraitsData()
		{
			this.Dispose();
		}

		public virtual void Dispose()
		{
			if (this.swigCPtr.Handle != IntPtr.Zero)
			{
				if (this.swigCMemOwn)
				{
					lock (this.locker)
					{
						if (this.swigCPtr.Handle != IntPtr.Zero && this.swigCMemOwn)
						{
							this.swigCMemOwn = false;
							GlobalsPINVOKE.delete_OdGiLightTraitsData(this.swigCPtr);
						}
					}
					this.swigCMemOwn = false;
				}
				this.swigCPtr = new HandleRef(null, IntPtr.Zero);
			}
			GC.SuppressFinalize(this);
		}

		public bool isOn()
		{
			bool result = GlobalsPINVOKE.OdGiLightTraitsData_isOn(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void setOn(bool value)
		{
			GlobalsPINVOKE.OdGiLightTraitsData_setOn(this.swigCPtr, value);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public double intensity()
		{
			double result = GlobalsPINVOKE.OdGiLightTraitsData_intensity(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void setIntensity(double dIntensity)
		{
			GlobalsPINVOKE.OdGiLightTraitsData_setIntensity(this.swigCPtr, dIntensity);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdCmEntityColor color()
		{
			OdCmEntityColor result = new OdCmEntityColor(GlobalsPINVOKE.OdGiLightTraitsData_color(this.swigCPtr), true);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void setColor(OdCmEntityColor color)
		{
			GlobalsPINVOKE.OdGiLightTraitsData_setColor(this.swigCPtr, OdCmEntityColor.getCPtr(color));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGiShadowParameters shadowParameters()
		{
			OdGiShadowParameters result = new OdGiShadowParameters(GlobalsPINVOKE.OdGiLightTraitsData_shadowParameters(this.swigCPtr), true);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void setShadowParameters(OdGiShadowParameters arg0)
		{
			GlobalsPINVOKE.OdGiLightTraitsData_setShadowParameters(this.swigCPtr, OdGiShadowParameters.getCPtr(arg0));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGiDrawable.DrawableType type()
		{
			OdGiDrawable.DrawableType result = (OdGiDrawable.DrawableType)GlobalsPINVOKE.OdGiLightTraitsData_type(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public static void deleteLightTraitsData(OdGiLightTraitsData pLightTraits)
		{
			GlobalsPINVOKE.OdGiLightTraitsData_deleteLightTraitsData(OdGiLightTraitsData.getCPtr(pLightTraits));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		private object locker = new object();

		private HandleRef swigCPtr;

		protected bool swigCMemOwn;
	}
}
